package com.cr.responsibilitychain;

public class Client {
    public static void main(String[] args) {
        // 创建请求
        PurchaseRequest purchaseRequest = new PurchaseRequest(1, 1000, 1);

        // 创建相关审批人
        DepartmentApprover departmentApprover = new DepartmentApprover("张主任");
        CollageApprover collageApprover = new CollageApprover("李主任");
        ViceSchoolMasterApprover viceSchoolMasterApprover = new ViceSchoolMasterApprover("佟校长");
        SchoolMasterApprover schoolMasterApprover = new SchoolMasterApprover("佟校长");

        // 需要将各个审批级别的下一个处理者设置好（处理人构成环状）
        departmentApprover.setApprover(collageApprover);
        collageApprover.setApprover(viceSchoolMasterApprover);
        viceSchoolMasterApprover.setApprover(schoolMasterApprover);
        schoolMasterApprover.setApprover(departmentApprover);

         departmentApprover.processRequest(purchaseRequest);
        viceSchoolMasterApprover.processRequest(purchaseRequest);

    }
}
